package com.hosever.utils;

/**
 * 逻辑运算测试
 * @author Sever
 *
 */
public class LogicalOperationTest {
	public static void main(String[] args) {
		int a = 1;//001
		int b = 2;//010
		int c = 3;//011
		
		System.out.print("A+B·C=(A+B)·(A+C):");
		System.out.print((a|b&c)+" ");
		System.out.print(((a|b)&(a|c))+" ");
		System.out.println( (a|b&c) == ((a|b)&(a|c)) );
		
		System.out.print("(A+B)'=A'·B':");
		System.out.print((~(a|b))+" ");
		System.out.print((~a&~b)+" ");
		System.out.println( (~(a|b)) == (~a&~b) );
		
		System.out.print("(A·B)'=A'+B':");
		System.out.print((~(a&b))+" ");
		System.out.print((~a|~b)+" ");
		System.out.println( (~(a&b)) == (~a|~b) );
	}
}
